<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="css/index.css">
    <script src="js/vue.js"></script>
    <script src="js/elementui.js"></script>
    <script src="js/axios.js"></script>
    <script src="js/common.js"></script>
    <title>Document</title>
</head>

<body>
    <div id="app">
        <div id="all-from">
            <h2>修改用户</h2>
            <template>
                <el-table :data="tableData" border style="width: 100%">
                    <el-table-column prop="unaem" label="用户名" width="180">
                    </el-table-column>
                    <el-table-column prop="upwd" label="密码" width="180">
                    </el-table-column>
                </el-table>
                <el-table-column label="操作">
                    <template slot-scope="scope">
                        <el-button size="mini" @click="update">修改</el-button>
                    </template>
                </el-table-column>
            </template>
        </div>

                <el-dialog title="修改用户" :visible.sync="dialogFormVisibleUp">
                    <el-form :model="formup">
                        <el-form-item label="用户名" label-width="80px">
                            <el-input v-model="formup.uname" autocomplete="off"></el-input>
                        </el-form-item>
                        <el-form-item label="密码" label-width="80px">
                            <el-input v-model="formup.upwd" autocomplete="off"></el-input>
                        </el-form-item>
                        
                    </el-form>
                    <div slot="footer" class="dialog-footer">
                        <el-button @click="dialogFormVisibleup = false">取 消</el-button>
                        <el-button type="primary" @click="upsubmit = false">确 定</el-button>
                    </div>
                </el-dialog>
    </div>
</body>
<script>
    new Vue({
        el: "#app",
        data: {
            tableData:[],
            form: {
                uname: '',
                upwd: ''
            },
            dialogFormVisibleUp: false,
            formup: {
                uname: '',
                upwd: ''
            }
        },
        methods: {
            init(){
                let that = this
                axios.get(API + "boot/selectAll").then(function (res) {
                    console.log(res.data.data.userList)
                }).catch(err => {
                    console.log(err)
                })
            }
           ,update(){

                this.dialogFormVisibleUp = true;
           },
            upsbmit(){    
                console.log(this.formup)
            }

        },mounted() {
            this.init();
        }
    })
</script>

</html>